﻿using System;
using System.ComponentModel.DataAnnotations;
using Util.Domains.Trees;

namespace IterationLife.System.Queries {
    /// <summary>
    /// 行政区域查询实体
    /// </summary>
    public class DistrictQuery : TreeQueryBase {
        /// <summary>
        /// 行政区域编号
        /// </summary>
        [Display(Name="行政区域编号")]
        public Guid? DistrictId { get; set; }
        
        private string _code = string.Empty;
        /// <summary>
        /// 编码
        /// </summary>
        [Display(Name="编码")]
        public string Code {
            get { return _code == null ? string.Empty : _code.Trim(); }
            set{ _code=value;}
        }
        
        private string _parentCode = string.Empty;
        /// <summary>
        /// 父编码
        /// </summary>
        [Display(Name="父编码")]
        public string ParentCode {
            get { return _parentCode == null ? string.Empty : _parentCode.Trim(); }
            set{ _parentCode=value;}
        }
        
        private string _name = string.Empty;
        /// <summary>
        /// 名称
        /// </summary>
        [Display(Name="名称")]
        public string Name {
            get { return _name == null ? string.Empty : _name.Trim(); }
            set{ _name=value;}
        }
        
        private string _mergerName = string.Empty;
        /// <summary>
        /// 合并名称
        /// </summary>
        [Display(Name="合并名称")]
        public string MergerName {
            get { return _mergerName == null ? string.Empty : _mergerName.Trim(); }
            set{ _mergerName=value;}
        }
        
        private string _shortName = string.Empty;
        /// <summary>
        /// 短名称
        /// </summary>
        [Display(Name="短名称")]
        public string ShortName {
            get { return _shortName == null ? string.Empty : _shortName.Trim(); }
            set{ _shortName=value;}
        }
        
        private string _mergerShortName = string.Empty;
        /// <summary>
        /// 合并短名称
        /// </summary>
        [Display(Name="合并短名称")]
        public string MergerShortName {
            get { return _mergerShortName == null ? string.Empty : _mergerShortName.Trim(); }
            set{ _mergerShortName=value;}
        }
        
        private string _telCode = string.Empty;
        /// <summary>
        /// 区号
        /// </summary>
        [Display(Name="区号")]
        public string TelCode {
            get { return _telCode == null ? string.Empty : _telCode.Trim(); }
            set{ _telCode=value;}
        }
        
        private string _zipCode = string.Empty;
        /// <summary>
        /// 邮编
        /// </summary>
        [Display(Name="邮编")]
        public string ZipCode {
            get { return _zipCode == null ? string.Empty : _zipCode.Trim(); }
            set{ _zipCode=value;}
        }
        
        private string _pinYin = string.Empty;
        /// <summary>
        /// 拼音简码
        /// </summary>
        [Display(Name="拼音简码")]
        public string PinYin {
            get { return _pinYin == null ? string.Empty : _pinYin.Trim(); }
            set{ _pinYin=value;}
        }
        
        private string _fullPinYin = string.Empty;
        /// <summary>
        /// 全拼
        /// </summary>
        [Display(Name="全拼")]
        public string FullPinYin {
            get { return _fullPinYin == null ? string.Empty : _fullPinYin.Trim(); }
            set{ _fullPinYin=value;}
        }
        
        private string _english = string.Empty;
        /// <summary>
        /// 英文
        /// </summary>
        [Display(Name="英文")]
        public string English {
            get { return _english == null ? string.Empty : _english.Trim(); }
            set{ _english=value;}
        }
        /// <summary>
        /// 经度
        /// </summary>
        [Display(Name="经度")]
        public decimal? Longitude { get; set; }
        /// <summary>
        /// 纬度
        /// </summary>
        [Display(Name="纬度")]
        public decimal? Latitude { get; set; }
        
        private string _codePath = string.Empty;
        /// <summary>
        /// 编码路径
        /// </summary>
        [Display(Name="编码路径")]
        public string CodePath {
            get { return _codePath == null ? string.Empty : _codePath.Trim(); }
            set{ _codePath=value;}
        }
        
        /// <summary>
        /// 添加描述
        /// </summary>
        protected override void AddDescriptions() {
            base.AddDescriptions();
            AddDescription( "行政区域编号", DistrictId );
            AddDescription( "编码", Code );
            AddDescription( "父编码", ParentCode );
            AddDescription( "名称", Name );
            AddDescription( "合并名称", MergerName );
            AddDescription( "短名称", ShortName );
            AddDescription( "合并短名称", MergerShortName );
            AddDescription( "区号", TelCode );
            AddDescription( "邮编", ZipCode );
            AddDescription( "拼音简码", PinYin );
            AddDescription( "全拼", FullPinYin );
            AddDescription( "英文", English );
            AddDescription( "经度", Longitude );
            AddDescription( "纬度", Latitude );
            AddDescription( "编码路径", CodePath );
        }
        
        /// <summary>
        /// 检查查询参数是否全部为空
        /// </summary>
        protected override void CheckEmpty() {
            base.CheckEmpty();
            AddValue( DistrictId );
            AddValue( Code );
            AddValue( ParentCode );
            AddValue( Name );
            AddValue( MergerName );
            AddValue( ShortName );
            AddValue( MergerShortName );
            AddValue( TelCode );
            AddValue( ZipCode );
            AddValue( PinYin );
            AddValue( FullPinYin );
            AddValue( English );
            AddValue( Longitude );
            AddValue( Latitude );
            AddValue( CodePath );
        }
    }
}
